package io.gitee.wminyu.day02;

import java.util.Scanner;

public class fangcheng {
    public static void main(String[] args) {
        double x1,x2;
        System.out.println("请输入二次项系数、一次项系数和常数项的值");
        Scanner input = new  Scanner(System.in);
        double a = input.nextDouble();
        double b = input.nextDouble();
        double c = input.nextDouble();
        double m = Math.pow(b,2)-4*a*c;
//        System.out.println(m);
        if (m>=0){
            x1 = (-b+Math.sqrt(Math.pow(b,2)-4*a*c))/(2*a);
            x2 = (-b-Math.sqrt(Math.pow(b,2)-4*a*c))/(2*a);
            System.out.println("x1="+ x1 +"，" + "x2=" + x2);
        } else {
            System.out.println("此方程无解");
        }
    }
}
